//
//  WBDemoViewController.swift
//  传智微博
//
//  Created by FYXJ（6） on 2018/8/28.
//  Copyright © 2018年 FYXJ（6）. All rights reserved.
//

import UIKit

class WBDemoViewController: WBBaseViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        title = "第 \(String(describing: navigationController?.childViewControllers.count ?? 0)) 个"
    }
    @objc private func showNext () {
       let vc = WBDemoViewController()
        
        navigationController?.pushViewController(vc, animated: true)
    }
}

extension WBDemoViewController {
    override func setupTableView() {
        super.setupTableView()
        
        
//        let btn: UIButton = UIButton.cz_textButton("下一个", fontSize: 16, normalColor: UIColor.darkGray, highlightedColor: UIColor.orange)
//        btn.addTarget(self, action: #selector(showNext), for: .touchUpInside)
//        navigationItem.rightBarButtonItem = UIBarButtonItem(customView: btn)
        
        navItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", target: self, action: #selector(showNext))
        //设置右侧的控制器
        navigationItem.rightBarButtonItem = UIBarButtonItem(title: "下一个", style: .plain, target: self, action: #selector(showNext))
    }
}
